{include file="header"}
<div style="padding: 20px;">
 
<div style="padding: 10px; font-size: 12px; background-color: #f6f6f6; color: #FF5722;margin-bottom:10px"> 
<span style="">【字段设置】 {$v.name}</span>
</div>
 
<form class="layui-form" action="">
	<input type="hidden" name="id" value="{$v.id}">	
  <div class="layui-form-item">
    <label class="layui-form-label">别名</label>
     <div class="layui-input-inline">
      <input type="text" name="title" value="{$v.title}" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">会员展示</label>
     <div class="layui-input-inline">
       <select name="home" lay-verify="required">
        <option value="0" {if condition="$v['home'] eq 0"}selected="selected"{/if}>否home</option>
        <option value="1" {if condition="$v['home'] eq 1"}selected="selected"{/if}>是home</option>
       </select>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">后台展示</label>
     <div class="layui-input-inline">
       <select name="open" lay-verify="required">
        <option value="0" {if condition="$v['open'] eq 0"}selected="selected"{/if}>否open</option>
        <option value="1" {if condition="$v['open'] eq 1"}selected="selected"{/if}>是open</option>
       </select>
    </div>
  </div> 
  
  <div class="layui-form-item">
    <label class="layui-form-label">内容展示</label>
     <div class="layui-input-inline">
       <select name="open1" lay-verify="required">
        <option value="0" {if condition="$v['open1'] eq 0"}selected="selected"{/if}>否open1</option>
        <option value="1" {if condition="$v['open1'] eq 1"}selected="selected"{/if}>是open1</option>
       </select>
    </div>
  </div> 
  
  
   {if $v['class'] eq 3 || $v['class'] eq 4 || $v['class'] eq 7 }
  <div class="layui-form-item">
    <label class="layui-form-label">多条件展示</label>
     <div class="layui-input-inline">
       <select name="open2" lay-verify="required">
        <option value="0" {if condition="$v['open2'] eq 0"}selected="selected"{/if}>否open2</option>
        <option value="1" {if condition="$v['open2'] eq 1"}selected="selected"{/if}>是open2</option>
       </select>
    </div>
  </div> 
  {/if}
  
  
  <div class="layui-form-item">
    <label class="layui-form-label">列表展示</label>
     <div class="layui-input-inline">
       <select name="open3" lay-verify="required">
        <option value="0" {if condition="$v['open2'] eq 0"}selected="selected"{/if}>否open3</option>
        <option value="1" {if condition="$v['open2'] eq 1"}selected="selected"{/if}>是open3</option>
       </select>
    </div>
  </div> 
  
  <div class="layui-form-item">
    <label class="layui-form-label">自定义展示1</label>
     <div class="layui-input-inline">
      <input type="number" name="open4" value="{$v.open4}" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
    <div class="layui-form-mid layui-word-aux">字段open4</div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">自定义展示2</label>
     <div class="layui-input-inline">
      <input type="number" name="open4" value="{$v.open5}" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
    <div class="layui-form-mid layui-word-aux">字段open5</div>
  </div>
  
  
  <div class="layui-form-item">
    <label class="layui-form-label">必填</label>
     <div class="layui-input-inline">
       <select name="must" lay-verify="required">
        <option value="0" {if condition="$v['must'] eq 0"}selected="selected"{/if}>否must</option>
        <option value="1" {if condition="$v['must'] eq 1"}selected="selected"{/if}>是must</option>
       </select>
    </div>
  </div> 
   {if $v['class'] eq 3 || $v['class'] eq 4 || $v['class'] eq 7 }
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">配置</label>
    <div class="layui-input-block">
      <textarea name="morenzhi" class="layui-textarea" placeholder="请配置 例如 ：中文|中文,英文|英文">{$v.morenzhi}</textarea>
    </div>
  </div>
  {/if}
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="cms">立即提交</button>
    </div>
  </div>
</form>
 
<div>
{include file="footer"}
<script >
layui.use(['layedit', 'form', 'upload'],
function() {
    var form = layui.form,
    upload = layui.upload,
    jq = layui.jquery,
    layedit = layui.layedit;
    form.on('submit(cms)',function(data) {
        loading = layer.load(2, {
            shade: [0.2, '#000']
        });
        var param = data.field;
        jq.post("{:url("model/ziduanUpdate")}", param,
        function(data) {
            if (data.code == 1) {
                layer.close(loading);
                layer.msg(data.msg, {
                    icon: 1,
                    time: 1000
                },
                function() {
                    location.reload();
                });
            } else {
                layer.close(loading);
                layer.msg(data.msg, {
                    icon: 2,
                    anim: 6,
                    time: 1000
                });
            }
        });
        return false;
    });
})
</script>
